
<template>
  <div class="main-container">
    <div class="filtrate-bar">
      <div class="title-box">
        <div class="icon-box">
          <span class="wk wk-my-task icon" />
        </div>
        <span class="text">BU预入仓报告</span>
      </div>
    </div>

    <div class="table-content">
      <div class="handle-bar">
        <!--<a-button class="export-btn">导出</a-button>-->
      </div>
      <a-table :scroll="{ y: 500 }" :columns="fieldList" :data-source="tableList" bordered :pagination="false">
      </a-table>
    </div>
  </div>
</template>

<script>
import { httpAction, getAction } from '@/api/manage'
export default {
  name: 'prewarehouseBu',
  data() {
    return {
      loading: false,
      url: {
        forecastWmsInventoryAnalysis: '/online/api/forecastWmsInventoryAnalysis',
        exportXlsUrl: '/online/api/export/exportXlsGraphReport',
      },
      postParams: {}, // 筛选参数
      dataIndex: null,
      list: [],
      fieldList: [
        {
          title: '仓库',
          align: 'center',
          dataIndex: 'warehouseName',
          key: 'warehouseName',
          width: 60,
        },
        {
          title: '冷冻',
          align: 'center',
          children: [
            {
              title: '空余库位',
              align: 'center',
              dataIndex: 'availableFreeze',
              key: 'availableFreeze',
              width: 60,
            },
            {
              title: '下月入仓计划',
              align: 'center',
              dataIndex: 'estimatedFreezeNextMonth',
              key: 'estimatedFreezeNextMonth',
              width: 60,
            },
            {
              title: 'T+2月入仓计划',
              align: 'center',
              dataIndex: 'estimatedFreezeNext2Month',
              key: 'estimatedFreezeNext2Month',
              width: 60,
            },
            {
              title: '2个月后计划',
              align: 'center',
              dataIndex: 'estimatedFreezeNext3Month',
              key: 'estimatedFreezeNext3Month',
              width: 60,
            },
          ],
        },
        {
          title: '冷藏',
          align: 'center',
          children: [
            {
              title: '空余库位',
              align: 'center',
              dataIndex: 'availableRefrigerate',
              key: 'availableRefrigerate',
              width: 60,
            },
            {
              title: '下月入仓计划',
              align: 'center',
              dataIndex: 'estimatedRefrigerateNextMonth',
              key: 'estimatedRefrigerateNextMonth',
              width: 60,
            },
            {
              title: 'T+2月入仓计划',
              align: 'center',
              dataIndex: 'estimatedRefrigerateNext2Month',
              key: 'estimatedRefrigerateNext2Month',
              width: 60,
            },
            {
              title: '2个月后计划',
              align: 'center',
              dataIndex: 'estimatedRefrigerateNext3Month',
              key: 'estimatedRefrigerateNext3Month',
              width: 60,
            },
          ],
        },
        {
          title: '恒温',
          align: 'center',
          children: [
            {
              title: '空余库位',
              align: 'center',
              dataIndex: 'availableConstant',
              key: 'availableConstant',
              width: 60,
            },
            {
              title: '下月入仓计划',
              align: 'center',
              dataIndex: 'estimatedConstantNextMonth',
              key: 'estimatedConstantNextMonth',
              width: 60,
            },
            {
              title: 'T+2月入仓计划',
              align: 'center',
              dataIndex: 'estimatedConstantNext2Month',
              key: 'estimatedConstantNext2Month',
              width: 60,
            },
            {
              title: '2个月后计划',
              align: 'center',
              dataIndex: 'estimatedConstantNext3Month',
              key: 'estimatedConstantNext3Month',
              width: 60,
            },
          ],
        },
        {
          title: '常温',
          align: 'center',
          children: [
            {
              title: '空余库位',
              align: 'center',
              dataIndex: 'availableNormal',
              key: 'availableNormal',
              width: 60,
            },
            {
              title: '下月入仓计划',
              align: 'center',
              dataIndex: 'estimatedNormalNextMonth',
              key: 'estimatedNormalNextMonth',
              width: 60,
            },
            {
              title: 'T+2月入仓计划',
              align: 'center',
              dataIndex: 'estimatedNormalNext2Month',
              key: 'estimatedNormalNext2Month',
              width: 60,
            },
            {
              title: '2个月后计划',
              align: 'center',
              dataIndex: 'estimatedNormalNext3Month',
              key: 'estimatedNormalNext3Month',
              width: 60,
            },
          ],
        },
      ],
      tableList: [],
    }
  },
  computed: {},
  mounted() {
     this.getDataList();
  },
  methods: {
    /**
     * 导出点击
     */
    exportClick() {
      this.requestExportInfo(biCustomerTotalListExportAPI, this.listPostParams)
    },
    getDataList() {
    
          const param = {}
          param.onlyBu = 'Y'
          getAction(this.url.forecastWmsInventoryAnalysis, param).then((res) => {
        
            if (res.success) {this.tableList = res.result.workMap.dataListByWarehouse;}  
         })
      
    },
  },
}
</script>


<style lang="less" scoped>
/deep/ .ant-table-thead > tr > th,
.ant-table-tbody > tr > td {
  padding: 10px 4px;
}
.main-container {
  border: 1px solid #e6e6e6;
  border-radius: 2px;
  background-color: white;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: relative;
}

.filtrate-bar {
  background-color: white;
  padding: 15px 20px 5px 20px;
  margin-right: 15px;
  line-height: 34px;
  .icon-box {
    width: 34px;
    height: 34px;
    text-align: center;
    line-height: 34px;
    color: #168a40;
    background-color: #dfe8ff;
    border-radius: 50%;
    margin-right: 10px;
    float: left;
  }
  .text {
    font-size: 17px;
    font-weight: 700;
  }
}

.content-title {
  padding: 10px 20px 5px;
  font-size: 16px;
  color: #333;
}

.table-content {
  padding: 0 30px 20px 30px;
  /deep/.ant-table-thead > tr > th,
  .ant-table-tbody > tr > td {
    padding: 8px 8px !important;
  }
  /deep/ .ant-table-tbody > tr > td {
    padding: 8px 8px !important;
  }
}

.export-button {
  float: right;
  margin-right: 22px;
}

// 导出操作bug
.handle-bar {
  margin-bottom: 8px;
  text-align: right;
}

.search-box {
  padding-right: 15px;
}

.radio-box {
  padding: 0 20px;
  margin-bottom: 15px;
  /deep/ .el-radio__label {
    color: #99a9bf !important;
  }
}

.static {
  padding: 0 20px;
  margin-bottom: 10px;
  .text {
    font-size: 13px;
    color: #99a9bf;
    display: inline-block;
  }
  .text:not(:last-child) {
    margin-right: 15px;
  }
}
/deep/ .ant-table-wrapper {
  border: 1px solid #ebeef5;
}
</style>

